﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Domain
{
    public class InvoiceInfo : BaseItem
    {
        public string InvoiceNo { get; set; }
        public string FullName { get; set; }
        public string CompanyName { get; set; }
        public string StreetAddress { get; set; }
        public string ZipCode { get; set; }
        public string PhoneNumber { get; set; }
        public string EmailAddress { get; set; }

        public InvoiceInfo(DataRow row)
        {
            if (row != null)
            {
                if (row[Constants.Invoice.FullName] != null) FullName = Convert.ToString(row[Constants.Invoice.FullName]).Trim();
                if (row[Constants.Invoice.CompanyName] != null) CompanyName = Convert.ToString(row[Constants.Invoice.CompanyName]).Trim();
                if (row[Constants.Invoice.StreetAddress] != null) StreetAddress = Convert.ToString(row[Constants.Invoice.StreetAddress]).Trim();
                if (row[Constants.Invoice.PhoneNumber] != null) PhoneNumber = Convert.ToString(row[Constants.Invoice.PhoneNumber]).Trim();
                if (row[Constants.Invoice.ZipCode] != null) ZipCode = Convert.ToString(row[Constants.Invoice.ZipCode]).Trim();
                if (row[Constants.Invoice.EmailAddress] != null) EmailAddress = Convert.ToString(row[Constants.Invoice.EmailAddress]).Trim();
                if (row[Constants.Invoice.OrderGUID] != null) OrderGUID = Convert.ToString(row[Constants.Invoice.OrderGUID]).Trim();
            }
        }        
    }
}
